package org.code.chenwei.day02.ThreadLocal;


import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

/**
 * @BelongsProject: learn-learning-everyday
 * @BelongsPackage: org.chenwei.day02.ThreadLocal
 * @Author: Chen Wei
 * @CreateTime: 2024-01-12  15:20
 * @Description: TODO
 * @Version: 1.0
 */
@SuppressWarnings("all")
@Slf4j
public class InherTableThreadLocalTest {

    @Test
    public void inherTableThreadLocalDemo01() {
        InheritableThreadLocal<String> threadLocal = new InheritableThreadLocal<>();
        threadLocal.set("test");
        Thread thread=new Thread(()->{
            System.out.println(threadLocal.get());
        });



        thread.start();
        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
